package com.ysynzehao.controller;

import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * niuzehao
 * 2018/11/30 10:55.
 */
@RestController
@RequestMapping(value="/user")
public class TestController {

    @GetMapping("hello")
    public Object hello() {
        return "hello world";
    }

    @GetMapping("exception")
    public ResponseEntity<String> exception() {
        throw new RuntimeException("error");
    }

}
